Skip to content
This repository has been archived by the owner on Aug 20, 2020. It is now read-only.

Be nice(r) when no arguments given #63

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

clemens-tolboom
Copy link

Having a standalone install persistgraphql gives a stack dump

Usage: persistgraphql input_file [output_file]
(node:46389) UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be one of type string, Buffer, or URL. Received type undefined
at Object.fs.stat (fs.js:884:3)
at /usr/local/lib/node_modules/persistgraphql/lib/src/ExtractGQL.js:45:16
at new Promise ()
at Function.ExtractGQL.isDirectory (/usr/local/lib/node_modules/persistgraphql/lib/src/ExtractGQL.js:44:16)
at /usr/local/lib/node_modules/persistgraphql/lib/src/ExtractGQL.js:139:24
at new Promise ()
at ExtractGQL.readInputPath (/usr/local/lib/node_modules/persistgraphql/lib/src/ExtractGQL.js:138:16)
at /usr/local/lib/node_modules/persistgraphql/lib/src/ExtractGQL.js:129:19
at new Promise ()
at ExtractGQL.processInputPath (/usr/local/lib/node_modules/persistgraphql/lib/src/ExtractGQL.js:128:16)

With the patch

persistgraphql && echo Success not gona happen
persistgraphql || echo Failed

which is as expected.

Having a standalone install `persistgraphql` gives

> Usage: persistgraphql input_file [output_file]
(node:46389) UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be one of type string, Buffer, or URL. Received type undefined
    at Object.fs.stat (fs.js:884:3)
    at /usr/local/lib/node_modules/persistgraphql/lib/src/ExtractGQL.js:45:16
    at new Promise (<anonymous>)
    at Function.ExtractGQL.isDirectory (/usr/local/lib/node_modules/persistgraphql/lib/src/ExtractGQL.js:44:16)
    at /usr/local/lib/node_modules/persistgraphql/lib/src/ExtractGQL.js:139:24
    at new Promise (<anonymous>)
    at ExtractGQL.readInputPath (/usr/local/lib/node_modules/persistgraphql/lib/src/ExtractGQL.js:138:16)
    at /usr/local/lib/node_modules/persistgraphql/lib/src/ExtractGQL.js:129:19
    at new Promise (<anonymous>)
    at ExtractGQL.processInputPath (/usr/local/lib/node_modules/persistgraphql/lib/src/ExtractGQL.js:128:16)
@apollo-cla
Copy link

@clemens-tolboom: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Meteor Contributor Agreement here: https://contribute.meteor.com/

@ghost ghost added the standalone label May 27, 2018
@clemens-tolboom
Copy link
Author

Checking with #31 I only fixed the standalone variant. We need something similar as done in https://github.com/apollographql/persistgraphql/pull/31/files#diff-5c01c4c7bd17ea252db030eb6f9990b7R61

Added to this PR #63. Hope @Aides359 can get some credits.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants